#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""If you feel sad or angry, then just fuck the code with python.

My students do not like programming, and always play phone game in my class.
There are always some students absent. That motivates me to create the code.

What is fortunite, the girls work harder than boys.

The main function is `fuck`.
"""

import random

def shuffle(line, sep=' '):
    # shuffle words in a line (seperated by a whitespace)
    items = line.split(sep)
    random.shuffle(items)
    return sep.join(items)

def fuck(code):
    """Fuck the code

    Shuffle the code line with line, and word with word in a line.
    
    Arguments:
        code {str} -- the code of any programming language

    Examples:
        code = r'''
        import random

        def shuffle(line, sep=' '):
            items = line.split(sep)
            random.shuffle(items)
            return sep.join(items)

        def fuck(code):
            lines = code.split('\n')
            return '\n'.join([shuffle(line) for line in lines])
        '''

        print(fuck(code))
    """
    lines = code.split('\n')
    return '\n'.join([shuffle(line) for line in lines])

if __name__ == '__main__':
        
    code = r"""
    import random

    def shuffle(line, sep=' '):
        items = line.split(sep)
        random.shuffle(items)
        return sep.join(items)

    def fuck(code):
        lines = code.split('\n')
        return '\n'.join([shuffle(line) for line in lines])
    """

    print(fuck(code))